package com.cyj.dream.admin.service.system;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cyj.dream.admin.model.request.SysUserQueryRequest;
import com.cyj.dream.admin.model.system.SysUser;
import com.cyj.dream.core.constant.pagemodel.PageParam;

import java.util.List;

/**
 * @Description: 系统用户业务层
 * @BelongsProject: dream-DreamChardonnay
 * @BelongsPackage: com.dream.DreamChardonnay.service
 * @Author: ChenYongJia
 * @CreateTime: 2021-04-02 09:22
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
public interface SysUserService {

    /**
     * 分页查询系统用户信息
     *
     * @param pageParam 分页参数以及入参
     * @return com.dream.DreamChardonnay.constant.model.PageWrapper<com.dream.DreamChardonnay.model.vo.SysUserVo>
     * @date 2021/4/17 10:47
     * @author ChenYongJia
     * @version 1.0
     */
    IPage<SysUser> list(PageParam<SysUserQueryRequest> pageParam);

    /**
     * 查询系统用户信息
     *
     * @param queryRequest 入参参数
     * @return java.util.List<com.dream.DreamChardonnay.model.system.SysUser>
     * @date 2021/5/15 10:23
     * @author ChenYongJia
     * @version 1.0
     */
    List<SysUser> findBySysUserInfo(SysUserQueryRequest queryRequest);

    /**
     * 查询系统所有用户信息
     *
     * @return java.util.List<com.dream.DreamChardonnay.model.system.SysUser>
     * @date 2021/6/17 10:22
     * @author ChenYongJia
     * @version 1.0
     */
    List<SysUser> findAll();

    /**
     * 根据用户id查询用户
     *
     * @param sysUserId 用户id
     * @return com.dream.DreamChardonnay.model.system.SysUser
     * @date 2021-5-19 14:23:24
     * @author ChenYongJia
     * @version 1.0
     */
    SysUser findBySysUserId(Long sysUserId);

    /**
     * 添加用户信息
     *
     * @param sysUser 用户对象
     * @return boolean
     * @date 2021/4/21 9:27
     * @author ChenYongJia
     * @version 1.0
     */
    boolean addUserInfo(SysUser sysUser);

    /**
     * 逻辑删除用户信息
     *
     * @param sysUser 用户对象集合
     * @return boolean
     * @date 2021/5/20 10:27
     * @author ChenYongJia
     * @version 1.0
     */
    boolean delUserInfo(List<SysUser> sysUser);

    /**
     * 根据用户名称查询用户信息
     *
     * @param sysUserName
     * @return com.dream.DreamChardonnay.model.system.SysUser
     * @date 2021/4/2 9:30
     * @author ChenYongJia
     * @version 1.0
     */
    SysUser findBySysUserName(String sysUserName);

    /**
     * 修改用户详情
     *
     * @param sysUser 用户对象
     * @return java.lang.String
     * @date 2021/4/2 9:31
     * @author ChenYongJia
     * @version 1.0
     */
    boolean updUserPassWord(SysUser sysUser);

    /**
     * 修改用户详情--不含登录修改
     *
     * @param sysUser 用户对象
     * @return boolean
     * @date 2021/6/9 14:15
     * @author ChenYongJia
     * @version 1.0
     */
    boolean updateSysUserCloud(SysUser sysUser);

    /**
     * 根据token获取用户信息（根据 key 去 Redis 获取 value）
     *
     * @param token
     * @return
     */
    SysUser getSysUserByToken(String token);

    /**
     * 根据token退出登录（根据 key 去 Redis 删除 value） 0 成功 1 失败
     *
     * @param token
     * @return
     */
    Integer loginOutByToken(String token);

}
